<template>
    <div id="content">
        <div class="page-header">
            <div class="container-fluid">
                <div class="pull-right hidden">
                    <button type="button" data-toggle="tooltip" title=""
                            onclick="$('#filter-payment').toggleClass('hidden-sm hidden-xs');"
                            class="btn btn-default hidden-md hidden-lg" data-original-title="筛选">
                        <i class="fa fa-filter"></i></button>
                    <a href="#" data-toggle="tooltip" title="" class="btn btn-primary"
                       data-original-title="添加"><i class="fa fa-plus"></i></a>
                    <button type="button" data-toggle="tooltip" title="" class="btn btn-danger"
                            onclick="confirm('确认？') ? $('#form-payment').submit() : false;"
                            data-original-title="删除"><i class="fa fa-trash-o"></i></button>
                </div>
                <h1>支付管理</h1>
                <ul class="breadcrumb">
                    <li><a href="#/">首页</a></li>
                    <li><a href="#/payment/payment">支付分类</a></li>
                </ul>
            </div>
        </div>
        <div class="container-fluid">
            <div class="row">

                <div class="col-md-12 col-sm-12">
                <!--<div class="col-md-12 col-md-pull-12 col-sm-12">-->
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            <h3 class="panel-title"><i class="fa fa-list"></i> 支付分类列表</h3>
                        </div>
                        <div class="panel-body">
                            <form action="http://kkc.cloud.com/admin/index.php?route=payment/payment/delete&amp;user_token=0cfd8df4a55cee5e1fb9c135147feacb" method="post" enctype="multipart/form-data" id="form-payment">
                                <div class="table-responsive">
                                    <table class="table table-bordered table-hover">
                                        <thead>
                                        <tr>
                                            <td style="width: 1px;" class="text-center">
                                                <input type="checkbox"
                                                       onclick="$('input[name*=\'selected\']').trigger('click');">
                                            </td>
                                            <td class="text-left"><a href="#" class="asc">名称</a></td>
                                            <td class="text-left"><a href="#">状态</a></td>
                                            <td class="text-right">操作</td>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <tr v-for="payment in payment_list">
                                            <td class="text-center">
                                                <input type="checkbox" name="selected[]" value="1">
                                            </td>
                                            <td class="text-left">{{payment.name}}</td>
                                            <td class="text-left">
                                                <span v-show="payment.active==1">启用</span>
                                                <span v-show="payment.active==0">禁用</span>
                                            </td>
                                            <td class="text-right">
                                                <div class="btn-group" >
                                                    <a v-bind:href="'#/payment/payment/edit/' + payment.id"
                                                       data-toggle="tooltip" title=""
                                                       class="btn btn-primary" data-original-title="编辑">
                                                        <i class="fa fa-pencil"></i>
                                                    </a>
                                                </div>
                                            </td>
                                        </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </form>
                            <div class="row">
                                <div class="col-sm-6 text-left"></div>
                                <div class="col-sm-6 text-right">显示 1 - 1 / 合计 1（共 1 页）</div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>

<script>
    export default {

        data:function(){
            return {
                payment_list:[]
            }
        },

        methods:{

            get_payment_list:function(){

                var url = this.config.web_url + '/admin.php?r=payment';
                var t = this;

                this.axios.get( url ).then(function( res ){

                    t.payment_list = res.data;

                });

            }
        },

        created:function(){

            this.get_payment_list();
        }

    }
</script>

<style scoped>



</style>